Course 6 - Explore Sudo
In this activity, we will look at an example of using sudo in a command and we will also look at the sudoers file.
We will run the apt update command in order to update outdated packages Linux. For now, just think of it as updating Linux. From the terminal in Linux, type in “apt update”.
Unfortunately, this does not work and we get this message:
We see that we do not have permission to run this command. We need to escalate our privileges! Type the same command with “sudo” in front of it.
Great! It works. Using sudo gave you temporary permissions to run the apt update command. You should see this message:
Just for fun, let’s navigate to the sudoer’s file! Since we have not learned about navigating the filesystem yet, we will provide all the commands you need to input (the commands will be in parentheses). If you want, you can look at the next article first and come back to this activity later.
Congrats, you are looking at the sudoers file!